//
//$Id: qap_sa.h 441 2010-04-09 17:27:20Z Oleg.Bulychov $
#pragma once

#include "projects/qap/qap.h"
#include "solvers/sa/sa_common.h"

//__________________________________________________________________________________
template<>
struct solution<QAP_Solution, sa_tag>:
    public QAP_Solution
{
public:
    template<class E>
    void move(E* env, uniform_random& rnd, double probability)
    {
        int n = int(p_.size());
        for (int k = 0; k < env->cfg_.permutations_; ++k)
        {
            int i = rnd.next_UInt(n);
            int j = rnd.next_UInt(n);
            std::swap(p_[i], p_[j]);
        }

        changed_ = true;
    }
};
//__________________________________________________________________________________

//EOF!
